import { subscribeWithSelector } from 'zustand/middleware'
import create from 'zustand'
type StateStore = {
	isOpen: boolean
	_voiceInspireTime: number
}
type IStore = StateStore & {
	update: (d: Partial<StateStore>) => void
	reset: () => void
}
const initialState: StateStore = {
	isOpen: false,
	_voiceInspireTime: 3,
}
export const useVoiceInspireStore = create<IStore>()(
	subscribeWithSelector((set, get) => ({
		...initialState,
		update: (d) => set({ ...d }),
		reset: () => set(initialState),
	}))
)
